
public class TestPoint {
	public static void main(String[] args) {
		Point p1 = new Point();
		p1.x = 10;
		p1.y = 20;
		Point p2 = new Point();
		p2.x = 30;
		p2.y = 40;
		
		System.out.println(p1.getDistance(p2));
//		System.out.println(getDis(10,20,30,40));
		Point p3 = new Point();
		p3.x = 10;
		p3.y = 20;
		p3.z = 30;
		
		Point p4 = new Point();
		p4.x = 20;
		p4.y = 30;
		p4.z = 40;
		
		System.out.println(p3.getDistance(p4));
	}
	
//	public static double getDis(double x1,double y1,double z1,double z2,double x2,double y2) {
//		return Math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
//	}
}

class Point {
	double x;
	double y;
	double z;
	
	public double getDistance(Point p) {
		double d = (x-p.x)*(x-p.x)+(y-p.y)*(y-p.y)+(z-p.z)*(z-p.z);
		return Math.sqrt(d);
	}
}